<template>
  <div>
    <div>

    </div>
   <div>
     <el-input aria-placeholder="用户名" v-model="username" class="login">
       <template slot="prepend">账号：</template>
     </el-input>
   </div>
    <div>
      <el-input aria-placeholder="密码" v-model="password" class="register">
        <template slot="prepend">密码：</template>
      </el-input>
    </div>
   <div>
     <el-button type="primary" @click="toHome">登录</el-button>
   </div>
  </div>
</template>

<script>
import Vue from 'vue'
import global from "@/global";
export default {
  name: "Login",
  data(){
    return {
      username:'',
      password:'',
    }
  },
  methods:{
    toHome:()=>{
      this.$axios({
        url:'http://localhost:8080/user/login',
        method:'',
        data:{
          'userName':'root',
          'password':'root'
        },
        header:{

        },
      }).then((rep)=>{
        console.log(rep)
      })
      global.user = 1;
      global.type = 0;
      this.$router.push('/home/Info')
    }
  }
}
</script>

<style scoped>
  .login{
    margin-top: 200px;
    width: 400px;
  }
  .register{
    margin-top: 20px;
    width: 400px;
    margin-bottom: 50px;
  }

</style>